import request from '@/utils/request'
import qs from 'qs'

/* 根据id查询 Grade */
export function getGradeApi(id) {
  return request({
    url: `/grade/${id}`,
    method: 'get'
  })
}
/* 条件、分页查询 Grade */
export function getGradesApi(pageNo, pageSize, grade) {
  return request({
    url: `/grade?${qs.stringify(grade)}`,
    params:{
      pageNo: pageNo,
      pageSize: pageSize,
    },
    method: 'get'
  })
}
/* 根据id删除 Grade */
export function delGradeApi(id) {
  return request({
    url: `/grade/${id}`,
    method: 'delete'
  })
}
/* 批量删除 Grade */
export function delGradesApi(grades) {
  return request({
    url: `/grade`,
    data:grades,
    method: 'delete'
  })
}
/* 修改 Grade */
export function updateGradeApi(form) {
  return request({
    url: `/grade`,
    method: 'put',
    data:form,
  })
}
/* 新增 Grade */
export function addGradeApi(form) {
  return request({
    url: `/grade`,
    method: 'post',
    data:form,
  })
}
/* 获取所有 Grade */
export function getAllGradesApi(form) {
  return request({
    url: `/grade/findAll`,
    method: 'get',
  })
}